﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WpfCalculator
{
    public abstract class Calculator
    {
        private double _result;

        public double Result
        {
            get { return _result; }
            set { _result = value; }
        }

        public double Add(double value)
        {
            return Result += value;
        }

        public double Substract(double value)
        {
            return Result -= value;
        }

        public double Multiply(double value)
        {
            return Result *= value;
        }

        public double Divide(double value)
        {
            return Result /= value;
        }

        public double Complementation(double value)
        {
            return Result %= value;
        }

        public double Part(double value)
        {
            return Result = 1 / value;
        }

        public double Square(double value)
        {
            return Result = value * value;
        }

        public double Negative(double value)
        {
            return Result = -1 * value;
        }

        public double Sqrt(double value)
        {
            return Math.Sqrt(value);
        }
    }
}
